﻿using System.Drawing;
using System.Windows.Forms;
using System;

namespace MipsPipelineSimulator
{
    public struct Animate
    {
        public Animate(Line line,int forward,int spanTime,Direction direction,string text,Font font,Brush brush,bool ifDisplayText,int distance,Graphics [] g)
        {
            this.line = line;
            this.forward = forward;
            this.spanTime = spanTime;
            this.direction = direction;
            this.text = text;
            this.font = font;
            this.brush = brush;
            this.ifDisplayText = ifDisplayText;
            this.distance = distance;
            this.g = g;        
        }
        public Line line;
        public int forward;
        public int spanTime;
        public Direction direction;
        public string text;
        public Font font;
        public Brush brush;
        public bool ifDisplayText;
        public int distance;
        public Graphics [] g;
    }

    public struct Line
    {
        public Line(Point from,Point end,Pen pen)
        {
            this.from = from;
            this.end = end;
            this.pen = pen;
        }
        public Point from;
        public Point end;
        public Pen pen;
    }

    public struct DrawPaths
    {
        public DrawPaths(Animate[] animate,Control control)
        {
            this.animate = animate;
            this.control = control;
        }
        public Animate[] animate;
        public Control control;
    }

    public struct DrawPath
    {
        public DrawPath(Graphics[] graphics, Point[] points, Pen pen)
        {
            this.graphics = graphics;
            this.points = points;
            this.pen = pen;
        }
        public Graphics[] graphics;
        public Point[] points;
        public Pen pen;
    }

    public struct Blink
    {
        public Blink(string text, Point position, int times, int showSpanTime, int hideSpanTime,Control control)
        {
            this.text = text;
            this.position = position;
            this.times = times;
            this.showSpanTime = showSpanTime;
            this.hideSpanTime = hideSpanTime;
            this.control = control;
        }
        public string text;
        public Point position;
        public int times;
        public int showSpanTime;
        public int hideSpanTime;
        public Control control;
    }

    public enum Direction { LeftToRight, TopToBottom, BottomToTop, RightToLeft };

    public struct Code
    {
        public Code(CodeType codeType, object[] args)
        {
            this.codeType = codeType;
            this.args = args;
        }
        public CodeType codeType;
        public object [] args;
    }

    public enum CodeType{
            ADD,ADDU,SUB,SUBU,MUL,SLT,SLTU,ADDI,ADDIU,SLTI,SLTIU,DADD,DADDI,
            DADDU,DADDIU,DSUB,DSUBU,
            AND,NOR,OR,XOR,ANDI,ORI,XORI,
            SLL,SRA,SRL,SLLV,SRAV,SRLV,DSLL,DSRL,DSRA,DSLLV,DSRLV,DSRAV,
            BEQZ,BNEZ,
            LB,LH,LW,LBU,LHU,LWU,LD,SD,SB,SH,SW,
            ADD_S,ADD_D,SUB_S,SUB_D,MUL_S,MUL_D,DIV_S,DIV_D,
            LDC1,LWC1,SDC1,SWC1,OVER,NOP,ERR,UNSUPPOTED};
}